package com.qzq.weibo.fragment;

import com.qzq.weibo.R;

import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

public class DiscoverFragment extends Fragment {

	private View rootView;

	public static DiscoverFragment getInstance() {
		return new DiscoverFragment();
	}

	@Override
	public View onCreateView(LayoutInflater inflater, ViewGroup container,
			Bundle savedInstanceState) {

		if (rootView != null) {
			ViewGroup parent = (ViewGroup) rootView.getParent();

			if (parent != null) {
				parent.removeView(rootView);
			}

			return rootView;
		} else {
			View view = inflater.inflate(R.layout.fragment_discover, null);
			rootView = view;
			return view;
		}
	}

}
